# encoding: utf-8
import datetime
import json
import time
from random import choice

import requests
from pytz import timezone
import urllib.parse as parse
import re
from math import ceil
from multiprocessing import Pool
from lxml import html
# from fake_useragent import UserAgent
from xlutils.copy import copy
from xlrd import open_workbook
import execjs
import io
import sys

# sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='gb18030')
import datetime
import urllib3

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
session = requests.session()
tls = [
    'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA:AES256-SHA:',
    'ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!AESGCM',
    'ECDHE-ECDSA-AES256-GCM-SHA384:HIGH:!MEDIUM:!LOW:!aNULL:!eNULL:!DES:!MD5:!PSK:!RC4:!kRSA:!SRP:!3DES:!DSS:!EXP:!CAMELLIA:@STRENGTH',
    'EECDH+AESGCM:EDH+AESGCM',
    'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:RC4:HIGH:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH',
    'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!eNULL:!NULL:!EDH',
    'ALL'
]


def po(o):
    import requests
    params = {
        "group": "tt",  # 接口名称
        "action": "qwe",  # 注册的服务名
        # "page": i
    }
    # for i in range(10):
    res = requests.get("https://sekiro.virjar.com/business/invoke", params=params, verify=False).json()
    # print(res)

    cookies = {
        'ti_geo': 'country=CN^|city=GUANGZHOU^|continent=AS^|tc_ip=120.197.120.174',
        'ti_ua': 'Mozilla^%^2f5.0^%^20(Windows^%^20NT^%^2010.0^%^3b^%^20Win64^%^3b^%^20x64)^%^20AppleWebKit^%^2f537.36^%^20(KHTML,^%^20like^%^20Gecko)^%^20Chrome^%^2f94.0.4606.81^%^20Safari^%^2f537.36',
        'bm_sz': '55F5DE2B56A4F16F797AAD44B9ECF5A6~YAAQHFCcJA/7q1p8AQAAGh1Fog0ryrp+O+eZLtXxHdSzhcKFr1otJyVCESawxAFAZcZRyBWYBfFN+y4QbrOhetRHYHLA8Y9qEXQPyc+D1uqG/q0cViSVvYxGNkkTZLSD6Hvsqom4ILtBFMZOXSN5Dd4Ep3S0l1seFa8l0LbeeQuhzcz7+UmRbehmM56c9Vrd629X5a+LbQXzJI1gh9lp3XnSwb7dnpMcnFWipRcwTuCi2iikzzh7RAcJ1Di45pP2Zo3ggLs1cxJUpBLz1SNhymi4wDLQvT7gOkyoTvrgUu+2gAa43u8WbdO59lZdQbUJ5xjL5/CBnarz8ZLY0X+oeTANgNDOxt7khl2GhC6/h88NHp9CFIlD0Nw7y8IufWvqDl4iC7t4yb4ghPLI12I=~3749190~3422021',
        'pf-accept-language': 'en-US',
        'user_pref_language': 'en-US',
        'user_pref_currency': '^\\^USD^\\^',
        'CONSENTMGR': 'ts:1634810011186^%^7Cconsent:true',
        'tiSessionID': '017ca2451e350032381f91a07a5c05072004906a00978',
        'tipage': '^%^2Ftistore^%^2Fquick^%^20add^%^20to^%^20cart-en',
        'tipageshort': 'quick^%^20add^%^20to^%^20cart-en',
        'ticontent': '^%^2Ftistore',
        '_ga': 'GA1.2.730961721.1634810012',
        '_gid': 'GA1.2.1037709379.1634810012',
        'last-domain': 'www.ti.com',
        'ak_bmsc': '46F87BC27E1B97125D465712C2BF0945~000000000000000000000000000000~YAAQHFCcJLD7q1p8AQAANyNFog2Ig6VRyMVyNd2Y+rnaHu8Aqlpfb/yJ69TqmjyNI48QFC5dIpR7LAUx4gDA2MSs6kLwm9qVkK+mFDQuP/ZdR6kXaZX6fPYCiYx+aoBwJofM+2Ws63RGoD9PJ/0SNND7X89hibA0BgVtfPfdR8Dq4RAa9zecxz7KbozXwkmZ76YJHN3HitpA7Mfes1buSP3ElnF7SxZIL1UdyAk5VCNsAlY5L+SIpQomnUIQkeYqeiuZ4aXznCP65iQ6MCSxl1tXMFCogCMedDWD0i+8nXCiQBN8foeaAAmghHcpHg7ZgCHkqX82daY6bNS4Vcsa5mHj1XZ73ryci7kA+vrZuF8WvOrqR6p8FmXrv7JeGNzsj2pKt//frC72C96Ju1LTm8s9YzlBy/2MrozQxOCWM+Bb+sTzkEbonjkIJiTUYSIBgIniqZ68w126d/jpO/uXVVMAQClIneW5zvG3RrKvyA==',
        '_gcl_au': '1.1.482232710.1634810013',
        '__adroll_fpc': 'd4a8452f6074d175f9f6e9fa68422b6d-1634810013068',
        'ti_bm': '',
        'userType': 'Anonymous',
        'gpn': 'Non-Product',
        'ga_page_cookie': 'quick^%^20add^%^20to^%^20cart-en',
        'ga_content_cookie': '^%^2Ftistore',
        'bm_sv': '9182058788021A0C26D4F3467083AF6E~Q1PououYW9GOu+raCd4OMi6A01Iq9kb687Hq6Qu3sLuAfBLJF8uTIvFVq3XbsqynJl94bxmQvPWszPeDNBN9uBf5LU6TpQMBYjjgGhxNuc+8ENDbQLRFn9br4/LIng3RCeX31AHulyNPyz0b84/5bQ==',
        '_gat_ga_main_tracker': '1',
        'utag_main': 'v_id:017ca2451e350032381f91a07a5c05072004906a00978^$_sn:2^$_ss:1^$_st:1634814647707^$free_trial:true^$_pn:1^%^3Bexp-session^$ses_id:1634812846964^%^3Bexp-session',
        '__ar_v4': '3OPH2YZKH5EPHOAY2EZOAG^%^3A20211020^%^3A4^%^7CTH5I4ZH44BE57MRNCQW6WD^%^3A20211020^%^3A4^%^7CYHXMSR6KVVHP3GVAHYZHTF^%^3A20211020^%^3A4',
        'ti_rid': '	358b4a2c',
        '_abck': 'C09D38F90495B51F23F6173C8E338559~-1~YAAQTQ1x34KcbVZ8AQAA6g55ogZCA5vjS5zvFLN7cfKdF78ziWCFf2z2wApdNj+7tSaDkkTsviflzugjCOqJkpvLPiYYSu9n6+opOW/E2FlbWuBeVWt/1o1drSML0QXNt/QVLefQqP88clnbSC1rAmbLMoLrbH/u1Nxe4xP401x95kRgOjt2fgMaoBaF5bM1ma9arcNBXKutnfM0Hml+O+cds82wGYV58EhNU5W0SW6cQEP5c+FB4BxW+4mWNfYkQhxXJcqYwuSvt+E0dW45TJ0MEeifCGJINRLRlQt40kpQ6R6MtkWYHlzM4ztBBMywM0gUJGTeRw8pHI6WHL5RXyaFYuGhGIAUGD4eXVGNMScOm9Y2xDmlkM67PzsdX+KHiPSZ7ba9bjCZzwl/BLtWJWFAMqt+B+CpWsIhtpRzp+EBp2Hcnbz9yn/9jLIh2P0EVdaqFswXcg+V8sKFMoRiwA==~-1~-1~-1',
     }

    headers = {
        'Connection': 'keep-alive',
        'Pragma': 'no-cache',
        'Cache-Control': 'no-cache',
        'X-Sec-Clge-Req-Type': 'ajax',
        'sec-ch-ua-mobile': '?0',
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36',
        'sec-ch-ua': '^\\^Chromium^\\^;v=^\\^94^\\^, ^\\^Google',
        'sec-ch-ua-platform': '^\\^Windows^\\^',
        'Content-Type': 'text/plain;charset=UTF-8',
        'Accept': '*/*',
        'Origin': 'https://www.ti.com',
        'Sec-Fetch-Site': 'same-origin',
        'Sec-Fetch-Mode': 'cors',
        'Sec-Fetch-Dest': 'empty',
        'Referer': 'https://www.ti.com/ordering-resources/buying-tools/quick-add-to-cart.html',
        'Accept-Language': 'zh-CN,zh;q=0.9',
    }

    data = {"sensor_data": res['data']}
    print(data)
    # {'sensor_data': '7a74G7m23Vrp0o5c9293291.7-1,2,-94,-100,Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36,uaend,12147,20030107,zh-CN,Gecko,5,0,0,0,402240,392620,1536,864,1536,864,1536,272,1536,,cpen:0,i1:0,dm:0,cwen:0,non:1,opc:0,fc:0,sc:0,wrc:1,isc:0,vib:1,bat:1,x11:0,x12:1,8279,0.711392559355,817405196310,0,loc:-1,2,-94,-101,do_en,dm_en,t_en-1,2,-94,-105,-1,2,-94,-102,0,0,0,0,-1,-1,0;-1,2,-94,-108,-1,2,-94,-110,0,1,6135,446,1149;1,1,6138,446,1149;2,1,6143,416,1128;3,1,6152,396,1112;4,1,6158,382,1100;5,1,6168,374,1092;6,1,6175,372,1088;7,1,6184,370,1087;8,1,6191,369,1086;9,1,6287,372,1085;10,1,6295,377,1084;11,1,6303,387,1082;12,1,6311,399,1081;13,1,6319,414,1079;14,1,6327,434,1077;15,1,6335,451,1077;16,1,6343,476,1078;17,1,6350,496,1080;18,1,6359,517,1085;19,1,6367,533,1088;20,1,6375,547,1091;21,1,6383,559,1094;22,1,6391,570,1096;23,1,6399,580,1099;24,1,6407,588,1100;25,1,6415,596,1101;26,1,6423,601,1103;27,1,6431,607,1104;28,1,6439,609,1104;29,1,6447,612,1104;30,1,6455,613,1105;31,1,6463,616,1106;32,1,6471,618,1106;33,1,6478,620,1107;34,1,6487,624,1108;35,1,6495,628,1112;36,1,6503,634,1113;37,1,6511,641,1116;38,1,6519,649,1120;39,1,6528,660,1124;40,1,6534,672,1128;41,1,6543,686,1133;42,1,6551,702,1137;43,1,6559,718,1140;44,1,6566,737,1144;45,1,6575,753,1148;46,1,6583,769,1152;47,1,6591,782,1154;48,1,6598,796,1156;49,1,6607,807,1159;50,1,6614,817,1160;-1,2,-94,-117,-1,2,-94,-111,0,50,-1,-1,-1;1,16185,-1,-1,-1;-1,2,-94,-109,0,50,-1,-1,-1,-1,-1,-1,-1,-1,-1;1,16151,-1,-1,-1,-1,-1,-1,-1,-1,-1;-1,2,-94,-114,-1,2,-94,-103,2,656;0,7025;1,16121;-1,2,-94,-112,https://www.ti.com/ordering-resources/buying-tools/quick-add-to-cart.html-1,2,-94,-115,1,413188,32,16236,16202,0,445594,16185,0,1634810392620,13,17488,0,51,2914,0,0,16190,358817,0,C09D38F90495B51F23F6173C8E338559~-1~YAAQHFCcJLqVrFp8AQAAq/RKogasV323yWjKPP8rCDwUlvElTr3BQslhfCDUM7RMoppMySoheI7dET+1BpVR/AypW57BSiVQJwnllC7V9H6/wUL4IxSCPvk5mz1JU/jEX5OgftQ1xE2rcBsJuMXMyKLUrE3fQs7a8PWTNQOQOMqEevPG+qrGnng5QniG5A9twvmOxGaeD/kEPAAfXSqRv0JIEj5zsHtOVAJ+2n1Hac2Eq6Gr9l601WmEY1dKTzKr0+YLi6FxAb+b+XDcCYpvW6xqwaVbdY3kpM3183ZSoKs+lUxQueDYrfDnApobvqibV5x/V6ZobJRe5JnKUg0Kety3m7+A4cDWNGlwphsHNtV4YgWB5n6lZcez8gsadmCPdVwBu52i1jng8SCtpqDl8eRFNeEhTOu0HITIpPyqzCHvkaxmsQy9cX0fIDGEOkscXpcZ5Y6HVTz1YnJs4orjdQ==~-1~-1~-1,43269,425,-933022568,30261693,PiZtE,60981,65,0,-1-1,2,-94,-106,6,3-1,2,-94,-119,0,20,20,20,20,20,20,0,20,0,0,0,0,120,-1,2,-94,-122,0,0,0,0,1,0,0-1,2,-94,-123,-1,2,-94,-124,-1,2,-94,-126,-1,2,-94,-127,11321144241322243122-1,2,-94,-70,875325766;54528711;dis;,7;true;true;true;-480;true;24;24;true;false;-1-1,2,-94,-80,5346-1,2,-94,-116,1177851-1,2,-94,-118,152825-1,2,-94,-129,0f3b9dfc69b0dd4f6d6f719efa0d213022b5ce250b69b2ae186044168b4ed0b0,1.25,e6a6b62042f2333998b8357baa6fe8b776aaad3c0b1692df334f2afaf3954baf,Google Inc. (Intel),ANGLE (Intel, Intel(R) UHD Graphics 620 Direct3D11 vs_5_0 ps_5_0, D3D11-24.20.100.6345),95f5b71fe531f867faa814bdd4050dd8057206d53ecec1163523560525884870,33-1,2,-94,-121,;24;7;0'}
    # {'sensor_data': '7a74G7m23Vrp0o5c9293291.7-1,2,-94,-100,Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36,uaend,12147,20030107,zh-CN,Gecko,5,0,0,0,402240,392620,1536,864,1536,864,1536,272,1536,,cpen:0,i1:0,dm:0,cwen:0,non:1,opc:0,fc:0,sc:0,wrc:1,isc:0,vib:1,bat:1,x11:0,x12:1,8279,0.711392559355,817405196310,0,loc:-1,2,-94,-101,do_en,dm_en,t_en-1,2,-94,-105,-1,2,-94,-102,0,0,0,0,-1,-1,0;-1,2,-94,-108,-1,2,-94,-110,0,1,6135,446,1149;1,1,6138,446,1149;2,1,6143,416,1128;3,1,6152,396,1112;4,1,6158,382,1100;5,1,6168,374,1092;6,1,6175,372,1088;7,1,6184,370,1087;8,1,6191,369,1086;9,1,6287,372,1085;10,1,6295,377,1084;11,1,6303,387,1082;12,1,6311,399,1081;13,1,6319,414,1079;14,1,6327,434,1077;15,1,6335,451,1077;16,1,6343,476,1078;17,1,6350,496,1080;18,1,6359,517,1085;19,1,6367,533,1088;20,1,6375,547,1091;21,1,6383,559,1094;22,1,6391,570,1096;23,1,6399,580,1099;24,1,6407,588,1100;25,1,6415,596,1101;26,1,6423,601,1103;27,1,6431,607,1104;28,1,6439,609,1104;29,1,6447,612,1104;30,1,6455,613,1105;31,1,6463,616,1106;32,1,6471,618,1106;33,1,6478,620,1107;34,1,6487,624,1108;35,1,6495,628,1112;36,1,6503,634,1113;37,1,6511,641,1116;38,1,6519,649,1120;39,1,6528,660,1124;40,1,6534,672,1128;41,1,6543,686,1133;42,1,6551,702,1137;43,1,6559,718,1140;44,1,6566,737,1144;45,1,6575,753,1148;46,1,6583,769,1152;47,1,6591,782,1154;48,1,6598,796,1156;49,1,6607,807,1159;50,1,6614,817,1160;-1,2,-94,-117,-1,2,-94,-111,0,50,-1,-1,-1;1,16185,-1,-1,-1;-1,2,-94,-109,0,50,-1,-1,-1,-1,-1,-1,-1,-1,-1;1,16151,-1,-1,-1,-1,-1,-1,-1,-1,-1;-1,2,-94,-114,-1,2,-94,-103,2,656;0,7025;1,16121;-1,2,-94,-112,https://www.ti.com/ordering-resources/buying-tools/quick-add-to-cart.html-1,2,-94,-115,1,413188,32,16236,16202,0,445594,16185,0,1634810392620,13,17488,0,51,2914,0,0,16190,358817,0,C09D38F90495B51F23F6173C8E338559~-1~YAAQHFCcJLqVrFp8AQAAq/RKogasV323yWjKPP8rCDwUlvElTr3BQslhfCDUM7RMoppMySoheI7dET+1BpVR/AypW57BSiVQJwnllC7V9H6/wUL4IxSCPvk5mz1JU/jEX5OgftQ1xE2rcBsJuMXMyKLUrE3fQs7a8PWTNQOQOMqEevPG+qrGnng5QniG5A9twvmOxGaeD/kEPAAfXSqRv0JIEj5zsHtOVAJ+2n1Hac2Eq6Gr9l601WmEY1dKTzKr0+YLi6FxAb+b+XDcCYpvW6xqwaVbdY3kpM3183ZSoKs+lUxQueDYrfDnApobvqibV5x/V6ZobJRe5JnKUg0Kety3m7+A4cDWNGlwphsHNtV4YgWB5n6lZcez8gsadmCPdVwBu52i1jng8SCtpqDl8eRFNeEhTOu0HITIpPyqzCHvkaxmsQy9cX0fIDGEOkscXpcZ5Y6HVTz1YnJs4orjdQ==~-1~-1~-1,43269,425,-933022568,30261693,PiZtE,60981,65,0,-1-1,2,-94,-106,6,3-1,2,-94,-119,0,20,20,20,20,20,20,0,20,0,0,0,0,120,-1,2,-94,-122,0,0,0,0,1,0,0-1,2,-94,-123,-1,2,-94,-124,-1,2,-94,-126,-1,2,-94,-127,11321144241322243122-1,2,-94,-70,875325766;54528711;dis;,7;true;true;true;-480;true;24;24;true;false;-1-1,2,-94,-80,5346-1,2,-94,-116,1177851-1,2,-94,-118,152825-1,2,-94,-129,0f3b9dfc69b0dd4f6d6f719efa0d213022b5ce250b69b2ae186044168b4ed0b0,1.25,e6a6b62042f2333998b8357baa6fe8b776aaad3c0b1692df334f2afaf3954baf,Google Inc. (Intel),ANGLE (Intel, Intel(R) UHD Graphics 620 Direct3D11 vs_5_0 ps_5_0, D3D11-24.20.100.6345),95f5b71fe531f867faa814bdd4050dd8057206d53ecec1163523560525884870,33-1,2,-94,-121,;24;7;0'}
    # {'sensor_data': '7a74G7m23Vrp0o5c9293291.7-1,2,-94,-100,Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36,uaend,12147,20030107,zh-CN,Gecko,5,0,0,0,402241,468064,1536,864,1536,864,1536,272,1536,,cpen:0,i1:0,dm:0,cwen:0,non:1,opc:0,fc:0,sc:0,wrc:1,isc:0,vib:1,bat:1,x11:0,x12:1,8279,0.975725836487,817405234032,0,loc:-1,2,-94,-101,do_en,dm_en,t_en-1,2,-94,-105,-1,2,-94,-102,-1,2,-94,-108,-1,2,-94,-110,-1,2,-94,-117,-1,2,-94,-111,0,40,-1,-1,-1;-1,2,-94,-109,0,40,-1,-1,-1,-1,-1,-1,-1,-1,-1;-1,2,-94,-114,-1,2,-94,-103,-1,2,-94,-112,https://www.ti.com/ordering-resources/buying-tools/quick-add-to-cart.html-1,2,-94,-115,1,32,32,40,40,0,80,647,0,1634810468064,57,17488,0,0,2914,0,0,648,80,0,C09D38F90495B51F23F6173C8E338559~-1~YAAQHFCcJLS9rFp8AQAAVxlMogYMeb+aBfQ95VJ7R2xW1kBoc++x1kjTHMrEXOny8kgcyBSBe+u+ykQ6QLdsUBAe9HxcczPMmYAHL2sTqhKl423bgAZ9mjKwPfZfEcjbKmMd3Y3RaKcXlkS2tzsJBMegn+64jG/iIdI64QDUHe9p6eG0rgv/50RSY3nCQUSfshJzKOIHpNi5dZUcYCvjR1RmoCh2GD5pJmEdYNWkiWB4Wz84g0BGAO09suNlaTRbnou4ocq+QUFLqXU6nSCfm1dVnTXSNxabpe9v4duEqX24iDUswAbhC/IrFZlteCP2x+y0Q04YVsbJeHHz1WiiEXNN8OkpgdnV+kx1Ke7pYKBXBo0YTzY1OFCUz9P/pInOnuMNPB5KducCiQFrDn+6vYfddWo4ZGIzq8F9UPvdmWdYOB3fz0ZhljGpJzIcEqvcL3Ya5GSMgApuZXzaI7dgWQ==~-1~-1~-1,43016,578,14529533,30261693,PiZtE,16057,51,0,-1-1,2,-94,-106,9,1-1,2,-94,-119,40,40,40,20,40,40,20,0,0,0,0,0,20,120,-1,2,-94,-122,0,0,0,0,1,0,0-1,2,-94,-123,-1,2,-94,-124,-1,2,-94,-126,-1,2,-94,-127,11321144241322243122-1,2,-94,-70,875325766;54528711;dis;,7;true;true;true;-480;true;24;24;true;false;-1-1,2,-94,-80,5346-1,2,-94,-116,63188430-1,2,-94,-118,98603-1,2,-94,-129,0f3b9dfc69b0dd4f6d6f719efa0d213022b5ce250b69b2ae186044168b4ed0b0,1.25,0,Google Inc. (Intel),ANGLE (Intel, Intel(R) UHD Graphics 620 Direct3D11 vs_5_0 ps_5_0, D3D11-24.20.100.6345),95f5b71fe531f867faa814bdd4050dd8057206d53ecec1163523560525884870,33-1,2,-94,-121,;20;4;0'}
    response = session.post('https://www.ti.com/q23YhZDLk6FyxhtcwST-u8wQCm0/LOf5QGcQEz7h/c3wnAQ/ak/cZFUNmcjsB',
                            headers=headers, cookies=cookies, data=data, verify=False)
    coo = response.cookies.get('_abck')
    print(response.cookies)
    import requests
    cookies = {
        'ti_ua': 'Mozilla^%^2f5.0^%^20(Windows^%^20NT^%^2010.0^%^3b^%^20Win64^%^3b^%^20x64)^%^20AppleWebKit^%^2f537.36^%^20(KHTML,^%^20like^%^20Gecko)^%^20Chrome^%^2f94.0.4606.81^%^20Safari^%^2f537.36',
        'bm_sz': '55F5DE2B56A4F16F797AAD44B9ECF5A6~YAAQHFCcJA/7q1p8AQAAGh1Fog0ryrp+O+eZLtXxHdSzhcKFr1otJyVCESawxAFAZcZRyBWYBfFN+y4QbrOhetRHYHLA8Y9qEXQPyc+D1uqG/q0cViSVvYxGNkkTZLSD6Hvsqom4ILtBFMZOXSN5Dd4Ep3S0l1seFa8l0LbeeQuhzcz7+UmRbehmM56c9Vrd629X5a+LbQXzJI1gh9lp3XnSwb7dnpMcnFWipRcwTuCi2iikzzh7RAcJ1Di45pP2Zo3ggLs1cxJUpBLz1SNhymi4wDLQvT7gOkyoTvrgUu+2gAa43u8WbdO59lZdQbUJ5xjL5/CBnarz8ZLY0X+oeTANgNDOxt7khl2GhC6/h88NHp9CFIlD0Nw7y8IufWvqDl4iC7t4yb4ghPLI12I=~3749190~3422021',
        'pf-accept-language': 'en-US',
        'user_pref_language': '^\\^en-US^\\^',
        'user_pref_currency': '^\\^USD^\\^',
        'CONSENTMGR': 'ts:1634810011186^%^7Cconsent:true',
        'tiSessionID': '017ca2451e350032381f91a07a5c05072004906a00978',
        'tipage': '^%^2Ftistore^%^2Fquick^%^20add^%^20to^%^20cart-en',
        'tipageshort': 'quick^%^20add^%^20to^%^20cart-en',
        'ticontent': '^%^2Ftistore',
        '_ga': 'GA1.2.730961721.1634810012',
        '_gid': 'GA1.2.1037709379.1634810012',
        'last-domain': 'www.ti.com',
        'ak_bmsc': '46F87BC27E1B97125D465712C2BF0945~000000000000000000000000000000~YAAQHFCcJLD7q1p8AQAANyNFog2Ig6VRyMVyNd2Y+rnaHu8Aqlpfb/yJ69TqmjyNI48QFC5dIpR7LAUx4gDA2MSs6kLwm9qVkK+mFDQuP/ZdR6kXaZX6fPYCiYx+aoBwJofM+2Ws63RGoD9PJ/0SNND7X89hibA0BgVtfPfdR8Dq4RAa9zecxz7KbozXwkmZ76YJHN3HitpA7Mfes1buSP3ElnF7SxZIL1UdyAk5VCNsAlY5L+SIpQomnUIQkeYqeiuZ4aXznCP65iQ6MCSxl1tXMFCogCMedDWD0i+8nXCiQBN8foeaAAmghHcpHg7ZgCHkqX82daY6bNS4Vcsa5mHj1XZ73ryci7kA+vrZuF8WvOrqR6p8FmXrv7JeGNzsj2pKt//frC72C96Ju1LTm8s9YzlBy/2MrozQxOCWM+Bb+sTzkEbonjkIJiTUYSIBgIniqZ68w126d/jpO/uXVVMAQClIneW5zvG3RrKvyA==',
        '_gcl_au': '1.1.482232710.1634810013',
        '__adroll_fpc': 'd4a8452f6074d175f9f6e9fa68422b6d-1634810013068',
        'ti_bm': '',
        'ga_page_cookie': 'quick^%^20add^%^20to^%^20cart-en',
        'ga_content_cookie': '^%^2Ftistore',
        'ELOQUA': 'GUID=222C3FEA5166483DBABFD909225B843A',
        'utag_main': 'v_id:017ca2451e350032381f91a07a5c05072004906a00978^$_sn:2^$_ss:0^$_st:1634814919272^$free_trial:true^$_pn:3^%^3Bexp-session^$ses_id:1634812846964^%^3Bexp-session',
        '__ar_v4': '3OPH2YZKH5EPHOAY2EZOAG^%^3A20211020^%^3A6^%^7CTH5I4ZH44BE57MRNCQW6WD^%^3A20211020^%^3A6^%^7CYHXMSR6KVVHP3GVAHYZHTF^%^3A20211020^%^3A6',
        'ti_geo': 'country=CN^|city=GUANGZHOU^|continent=AS^|tc_ip=120.237.92.150',
        'bm_sv': '9182058788021A0C26D4F3467083AF6E~Q1PououYW9GOu+raCd4OMi6A01Iq9kb687Hq6Qu3sLuAfBLJF8uTIvFVq3XbsqynJl94bxmQvPWszPeDNBN9uBf5LU6TpQMBYjjgGhxNuc/rCerV62GESkfBZyrjY6oA/+/zVRLtXxU2UD0hO5i/yQ==',
        'ti_rid': '358b3f3a',
        '_abck': 'C09D38F90495B51F23F6173C8E338559~-1~YAAQTQ1x34KcbVZ8AQAA6g55ogZCA5vjS5zvFLN7cfKdF78ziWCFf2z2wApdNj+7tSaDkkTsviflzugjCOqJkpvLPiYYSu9n6+opOW/E2FlbWuBeVWt/1o1drSML0QXNt/QVLefQqP88clnbSC1rAmbLMoLrbH/u1Nxe4xP401x95kRgOjt2fgMaoBaF5bM1ma9arcNBXKutnfM0Hml+O+cds82wGYV58EhNU5W0SW6cQEP5c+FB4BxW+4mWNfYkQhxXJcqYwuSvt+E0dW45TJ0MEeifCGJINRLRlQt40kpQ6R6MtkWYHlzM4ztBBMywM0gUJGTeRw8pHI6WHL5RXyaFYuGhGIAUGD4eXVGNMScOm9Y2xDmlkM67PzsdX+KHiPSZ7ba9bjCZzwl/BLtWJWFAMqt+B+CpWsIhtpRzp+EBp2Hcnbz9yn/9jLIh2P0EVdaqFswXcg+V8sKFMoRiwA==~-1~-1~-1',
    }

    headers = {
        'Connection': 'keep-alive',
        'Pragma': 'no-cache',
        'Cache-Control': 'no-store, must-revalidate',
        'sec-ch-ua': '^\\^Chromium^\\^;v=^\\^94^\\^, ^\\^Google',
        'sec-ch-ua-mobile': '?0',
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36',
        'Content-Type': 'application/json',
        'X-Sec-Clge-Req-Type': 'ajax',
        'Expires': '0',
        'sec-ch-ua-platform': '^\\^Windows^\\^',
        'Accept': '*/*',
        'Origin': 'https://www.ti.com',
        'Sec-Fetch-Site': 'same-origin',
        'Sec-Fetch-Mode': 'cors',
        'Sec-Fetch-Dest': 'empty',
        'Referer': 'https://www.ti.com/ordering-resources/buying-tools/quick-add-to-cart.html',
        'Accept-Language': 'zh-CN,zh;q=0.9',
    }


    data = f'["{o}"]'

    response = session.post('https://www.ti.com/storeservices/cart/inventory', headers=headers, verify=False,
                            cookies=cookies, data=data)
    print(response.text)


if __name__ == '__main__':
    print(datetime.datetime.now())
    asd = ["LM358DRG3", "TPL5111DDCR", "TPL5111DDCT", "BQ32002DR", "SE555-SP", "BQ4802Y", "INA290", "INA381-Q1",
           "INA181-Q1", "INA190", "INA240-Q1", "SMV512K32-SP", "SN54HC157-SP", "AM5748", "DRA76P", "TMP144",
           "TMP100-Q1", "DRV2665", "DRV8662", "DRV2511-Q1", "BQ79612-Q1", "UCC12041-Q1", "TPS629210-Q1", "BQ25175",
           "LM51581-Q1", "TPS628510", "AWR2243", "LMH9135", "LMH9235IRRLR", "LM358DRG4"]
    # pool = Pool(10)
    for i in asd:
        # requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS = choice(tls)
        # print(choice(tls))
        print('第几个', i)
        po(i)
    #     pool.apply_async(po, (i,))
    # pool.close()
    # pool.join()
    print(datetime.datetime.now())
